//应用入口
(function() {
    let insertPoint; //插入点位置
    let initJsFiles=["js/router.js", "js/spaUtil.js"];
    //总控制器
    window.addEventListener("hashchange", () => {
        window.spaUtil.getPage(insertPoint);
    }, false);
    
    function initJsFile(node,files){
    	files.forEach((item)=>{
	        let script = document.createElement("script");
            script.src = item;
            script.type = "text/javascript";
            script.charset = "UTF-8";
            node.appendChild(script);
    	});
    }
    
    function init() {
    	insertPoint = document.getElementById("insertPoint");
        let initLoadPoint = document.getElementsByTagName("head")[0];
        initJsFile(initLoadPoint,initJsFiles);
    }
    window.addEventListener("load", init, false);
})();